new Vue({
    el: '#app',
    data() {
        return {
            nodeKey: '',
            tableData: [],
            form: {
                Page: 1,
                Limit: 100,
                Condition: '',
            },
            formData: {},
            Total: 0,
            loading: false
        }
    },
    mounted() {
        let ls_URL = window.location.href;
        this.nodeKey = getQueryObject(ls_URL, "nodeKey");// 获取 nodeKey 参数
        let formDataJSON = sessionStorage.getItem("formData")
        this.formData = formDataJSON ? JSON.parse(formDataJSON) : {};
        this.getColumn();
    },
    methods: {
        handleSizeChange(newSize) {
            this.form.Page = 1;
            this.form.Limit = newSize;
            this.getList(this.form);
        },
        handleCurrentChange(newPage) {
            this.form.Page = newPage;
            this.getList(this.form);
        },
        getColumn(){
            this.loading = true;
            httpRequest({
                hostApi: BASE_URL1,
                url: '/generalQueryAllColumnByTableName',
                data: {
                    TableName:this.nodeKey
                },
                type:'GET'
            }).then(res => {
                if (res.Status == 'success') {
                    this.tableData = res.Data;
                } else {
                    this.$message({
                        message: '查询失败，请联系开发者!',
                        type: 'error'
                    })
                }
            }).catch(xhr => {
                this.$message({
                    message: '系统错误，请联系开发者!',
                    type: 'error'
                })
            }).finally(() => {
                this.loading = false;
            })
        },
        handleBack() {
            window.location.href = './index.html'
        }
    }
})